#include<iostream>
#include"UdpServe.hpp"
using namespace std;
void Usage(string proc)
{
    cout << "\n\rUsage: " << proc << " port[1024+]\n" << std::endl;
}
string Handler(const string &str)
{
    std::string res = "Server get a message: ";
    res += str;
    std::cout << res << std::endl;
    return res;
}
int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(0);
    }
    uint16_t port = stoi(argv[1]);
    UdpServe* tp=new UdpServe(port);
    tp->Init();
    tp->Run(Handler);
    return 0;
}
